<?php
	$jml_tandan = count($data['no_tandan']);
?>
<script type="text/javascript">
$(document).ready(function(){
	// functions
	<?php require('library/js/validator/functions.js');?>
	
	// tandan
    var jml_tandan = <?=$jml_tandan+1;?>;
	<?php require('library/js/form/input.tandan.js');?>
	
	// VALIDATOR
	// tandan
	<?php require('library/js/validator/form.input.tandan.js');?>
	
	// validation config
	<?php require('library/js/validator/config.bagging_betina.js');?>	
	
	$('input#tgl_bagging').datePicker();
});

</script>
<div class="title">Bagging Betina</div>

<textarea style="display:none" id="template_tandan">
	<li><span>
			<label>{0}</label>
			<input type="text" id="no_tandan-{0}" name="no_tandan-{0}" class="nomor_tandan"/>
			<input type="button" class="hapus_tandan button"  name="hapus_tandan" value="Hapus"/>
		</span>
	</li> 
</textarea>
<form name="frm_<?=$subbagian;?>" id="frm_<?=$subbagian;?>" method="post" action="index.php?bagian=<?=$bagian;?>&subbagian=<?=$subbagian;?>&action=confirm_edit">
    <ul>
    	<li class="header"><span>Identitas Individu</span></li>
        <li><span>
            <label>Tanggal Bagging:</label>
            <input type="text" id="tgl_bagging" name="tgl_bagging" value="<?=$data['tgl_bagging'];?>" readonly="readonly" class="disabled"/>
        </span></li>
         <li><span>
            <label>No Individu:</label>
            <input type="text" id="no_individu" name="no_individu" value="<?=$data['no_individu'];?>"/>
        </span></li>
         <li><span>
            <label>Varietas:</label>
            <input type="text" id="varietas" name="varietas" value="<?=$data['varietas'];?>"/>
        </span></li>
    </ul>
    <ul id="tandan">
		<li class="header"><span>No Tandan</span></li>
        <?php
        $no=0;
        foreach($data['no_tandan'] as $no_tandan){
        ?>
        <li><span>
			<label><?=++$no;?></label>
			<input type="text" id="no_tandan-<?=$no;?>" name="no_tandan-<?=$no;?>" class="nomor_tandan" value="<?=$no_tandan['no_tandan'];?>"/>
			<input type="button" class="hapus_tandan button"  name="hapus_tandan" value="Hapus"/>
		</span></li> 
        <?php
        }
        ?>
	    <li  class="button">
	      <input type="button" name="tambah_tandan" id="tambah_tandan" value="Tambah Baris"/>
	    </li>
    </ul>
	<ul>
		<li class="header"><span>Simpan</span></li>
		<li class="button"><span>
			<input type="submit" name="submit" id="submit" value="Simpan Data" class="simpan"/>
		</span></li>
	</ul>
</form>